home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1998
/
MacHack 1998.toast
/
The Hacks!
/
mhTV ƒ
/
TVSource
/
1BuildTVImport.ts
< prev
next >
Wrap
Text File
|
1998-06-20
|
3KB
|
74 lines
###=============================================================================
# STEP (1) Compile all the files into a directory full of xcoffs.
###=============================================================================
#This directory stores temp files and can be trashed when we're done.
Set XCOFF_DIR "{TEMP_ROOT}(PPC_TVImport.π XCOFF):"
###-----------------------------------------------------------------------------
If `Exists "{XCOFF_DIR}"`
Delete -y "{XCOFF_DIR}"
End
NewFolder "{XCOFF_DIR}"
###-----------------------------------------------------------------------------
Set SOURCE "{IMPORT_ROOT}TVImportComponent.c"
Set DESTINATION "{XCOFF_DIR}TVImportComponent.c.o"
mrc {C_OPTIONS} "{SOURCE}" -o "{DESTINATION}" {H_DIRS}
###-----------------------------------------------------------------------------
Echo "# Compiles done"
###=============================================================================
# STEP (2) Link.
###=============================================================================
#The -mf flag below tells PPCLink to use MultiFinder temp mem as appropriate.
#The -m flag sets the entry point to the UPP we have created in the source.
#The -codeorder flag tries to order the code in the file in a vaguely useful
# fashion as regards paging and TLB usage.
Set LINK_OPTIONS "-warn -codeorder staticcall -mf -m ImportTVSelectorDispatcher"
Set DESTINATION "{XCOFF_DIR}PPC_TVImport.π.pef"
#We have to screw around with changing the current directory to get the
#<files> command to work.
Set temp_dir `Directory`
Directory "{XCOFF_DIR}"
PPCLink {LINK_OPTIONS} `files ≈.o` {LIBRARIES} -o "{DESTINATION}"
Directory "{temp_dir}"
Echo "# Link done"
###=============================================================================
# STEP (3) Run MrPlus on the PEF.
###=============================================================================
Set SOURCE "{XCOFF_DIR}PPC_TVImport.π.pef"
Set FINAL_PEF "{XCOFF_DIR}PPC_TVImport.π.pef.opt"
If {USE_MR_PLUS}
MrPlus -opt static "{SOURCE}"
Else
Duplicate -y "{SOURCE}" "{FINAL_PEF}"
End
###=============================================================================
# STEP (4) Convert the PEF to a resource and add other resources.
###=============================================================================
Set FINAL_PEF "{XCOFF_DIR}PPC_TVImport.π.pef.opt"
Set SOURCE "{IMPORT_ROOT}BuildTVImport.r"
Set DESTINATION "{OUTPUT_ROOT}TV Import Component"
Export FINAL_PEF
Rez "{SOURCE}" -o "{DESTINATION}"
###=============================================================================
# STEP (6) Convert the output to the right type of file.
###=============================================================================
Setfile "{DESTINATION}" -t THNG -c RNST
Echo "# Import done"
###=============================================================================